<?php
require('config.php');
require('libraries/functions.php');
require('system/model.php');

if (isset($_GET['r'])) $route = $_GET['r'];
else $route = 'articles/index';

$file = "frontend/controllers/{$route}.php";

if (file_exists($file)) {
    require($file);
} else {
    header('HTTP/1.1 Not Found 404', true, 404);
    require('404.php');
    exit();
}
